package nc.ui.tc.Adjustrecord;

import java.util.ArrayList;
import java.util.List;

import nc.ui.pub.bill.BillCardPanel;
import nc.ui.pub.bill.BillItem;
import nc.ui.pub.bill.BillListPanel;

public class ShowItems {

	public static void showItem(BillListPanel billListPanel,String jobcode) {
		List<String> item = new ArrayList<String>();
		String[] items = new String[] { "summary",
				"contractno", "borrowdate", "repaymentdate", "capitalmoney",
				"yearinterestratio", "earlyloanbalances", "addcapitalmoney",
				"subcapitalmoney", "loanbalances", "interest", "creater",
				"createdate","choosemonth"};
		for (int i = 0; i < items.length; i++) {
			item.add(items[i]);
		}
		if("305030201".equals(jobcode))
		{
			item.add("proxytaxrate");
		}
		for (int i = 0; i < items.length; i++) {
			billListPanel.showHeadTableCol(items[i]);
		}

//		BillItem[] billItems = billListPanel.getHeadBillModel().getBodyItems();
//		for (int i = 0; i < billItems.length; i++) {
//			if (!item.contains(billItems[i].getKey())) {
//				billListPanel.showHeadTableCol(billItems[i].getKey());
////				billListPanel.getHeadItem(billItems[i].getKey())
////				.getCaptionLabel().setText("");
////				billListPanel.getHeadItem(billItems[i].getKey()).getComponent()
////						.setVisible(false);
//			}
//
//		}
	}
	
	
	public static void hiddenItem( BillListPanel billListPanel,String jobcode) {
//		List<String> item = new ArrayList<String>();
//		String[] items = new String[] { "bzbm", "pk_jobbasfil","userdept","billno","tzrq","ndfyys","cjr","cjrq","explanation","tzsm","m_year","tzy","creater",
//				"createdate", "remark" };
		String[] items = new String[] { "m_dept", "pk_jobbasfil","userdept","billno","description","billtype","billdate","fytzje","zjtzje","creater","createdate","m_year","tzsm","choosemonth"};
		
		if("302030401".equals(jobcode)||"302030402".equals(jobcode))
		{
			billListPanel.showHeadTableCol("showpk_jobbasfil_record");
		}
//		for (int i = 0; i < items.length; i++) {
//			item.add(items[i]);
//		}
		for (int i = 0; i < items.length; i++) {
			billListPanel.showHeadTableCol(items[i]);
		}
//		BillItem[] billItems = billListPanel.getHeadBillModel().getBodyItems();
//		for (int i = 0; i < billItems.length; i++) {
//			if (item.contains(billItems[i].getKey())) {
//				billListPanel.showHeadTableCol(billItems[i].getKey());
////				billListPanel.getHeadItem(billItems[i].getKey())
////						.getCaptionLabel().setText("");
////				billListPanel.getHeadItem(billItems[i].getKey()).getComponent()
////						.setVisible(false);
//			}
//
//		}
	}
}
